<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<TITLE>
Dictionary (Google Web Toolkit Javadoc)
</TITLE>

<META NAME="keywords" CONTENT="com.google.gwt.i18n.client.Dictionary class">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">

<SCRIPT type="text/javascript">
function windowTitle()
{
    parent.document.title="Dictionary (Google Web Toolkit Javadoc)";
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>

</HEAD>

<BODY BGCOLOR="white" onload="windowTitle();">


<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../com/google/gwt/i18n/client/DateTimeFormat.html" title="class in com.google.gwt.i18n.client"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../com/google/gwt/i18n/client/HasDirection.html" title="interface in com.google.gwt.i18n.client"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../../index.html?com/google/gwt/i18n/client/Dictionary.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="Dictionary.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
com.google.gwt.i18n.client</FONT>
<BR>
Class Dictionary</H2>
<PRE>
java.lang.Object
  <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>com.google.gwt.i18n.client.Dictionary</B>
</PRE>
<HR>
<DL>
<DT><PRE>public final class <B>Dictionary</B><DT>extends java.lang.Object</DL>
</PRE>

<P>
Provides dynamic string lookup of key/value string pairs defined in a
 module's host HTML page. Each unique instance of <code>Dictionary</code> is
 bound to a named JavaScript object that resides in the global namespace of
 the host page's window object. The bound JavaScript object is used directly
 as an associative array.
 
 <p>
 For example, suppose you define the following JavaScript object in your host
 page:
 
 <blockquote><pre>var CurrentTheme = {
  highlightColor: "#FFFFFF",
  shadowColor: "#808080",
  errorColor: "#FF0000",
  errorIconSrc: "stopsign.gif"
};
</pre></blockquote>
 
 You can then use a <code>Dictionary</code> to access the key/value pairs
 above:
 
 <blockquote><pre>public void useThemeDictionary() {
  Dictionary theme = Dictionary.getDictionary("CurrentTheme");

  String highlightColor = theme.get("highlightColor");
  String shadowColor = theme.get("shadowColor");
  applyShadowStyle(highlightColor, shadowColor);

  String errorColor = theme.get("errorColor");
  String errorIconSrc = theme.get("errorIconSrc");
  Image errorImg = new Image(errorIconSrc);
  showError(errorColor, errorImg);
}
</pre></blockquote>
 </p>
 
 <p>
 Unlike the family of interfaces that extend
 <A HREF="../../../../../com/google/gwt/i18n/client/Localizable.html" title="interface in com.google.gwt.i18n.client"><CODE>Localizable</CODE></A> which support static
 internationalization, the <code>Dictionary</code> class is fully dynamic.
 As a result, a variety of error conditions (particularly those involving key
 mismatches) cannot be caught until runtime. Similarly, the GWT compiler is
 unable discard unused dictionary values since the structure cannot be
 statically analyzed.
 </p>
 
 <h3>A Caveat Regarding Locale</h3>
 The module's host page completely determines the mappings defined for each
 dictionary without regard to the <code>locale</code> client property. Thus,
 <code>Dictionary</code> is the most flexible of the internationalization
 types and may provide the simplest form of integration with existing
 localization systems which were not specifically designed to use GWT's
 <code>locale</code> client property.
 
 <p>
 See <A HREF="../../../../../com/google/gwt/i18n/client/Localizable.html" title="interface in com.google.gwt.i18n.client"><CODE>Localizable</CODE></A> for background on the
 <code>locale</code> client property.
 </p>
 
 <h3>Required Module</h3>
 Modules that use this interface should inherit
 <code>com.google.gwt.i18n.I18N</code>.
 
 <blockquote><pre>&lt;module&gt;
  &lt;!-- other inherited modules, such as com.google.gwt.user.User --&gt;
  &lt;inherits name="com.google.gwt.i18n.I18N"/&gt;
  &lt;!-- additional module settings --&gt;
&lt;/module&gt;
</pre></blockquote>
<P>

<P>
<HR>

<P>

<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/google/gwt/i18n/client/Dictionary.html#get(java.lang.String)">get</A></B>(java.lang.String&nbsp;key)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the value associated with the given Dictionary key.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;<A HREF="../../../../../com/google/gwt/i18n/client/Dictionary.html" title="class in com.google.gwt.i18n.client">Dictionary</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/google/gwt/i18n/client/Dictionary.html#getDictionary(java.lang.String)">getDictionary</A></B>(java.lang.String&nbsp;name)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the <code>Dictionary</code> object associated with the given
 name.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.util.Set&lt;java.lang.String&gt;</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/google/gwt/i18n/client/Dictionary.html#keySet()">keySet</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The set of keys associated with this dictionary.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/google/gwt/i18n/client/Dictionary.html#toString()">toString</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.util.Collection&lt;java.lang.String&gt;</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../com/google/gwt/i18n/client/Dictionary.html#values()">values</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Collection of values associated with this dictionary.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="getDictionary(java.lang.String)"><!-- --></A><H3>
getDictionary</H3>
<PRE>
public static <A HREF="../../../../../com/google/gwt/i18n/client/Dictionary.html" title="class in com.google.gwt.i18n.client">Dictionary</A> <B>getDictionary</B>(java.lang.String&nbsp;name)</PRE>
<DL>
<DD>Returns the <code>Dictionary</code> object associated with the given
 name.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>name</CODE> - 
<DT><B>Returns:</B><DD>specified dictionary
<DT><B>Throws:</B>
<DD><CODE>java.util.MissingResourceException</CODE></DL>
</DD>
</DL>
<HR>

<A NAME="get(java.lang.String)"><!-- --></A><H3>
get</H3>
<PRE>
public java.lang.String <B>get</B>(java.lang.String&nbsp;key)</PRE>
<DL>
<DD>Get the value associated with the given Dictionary key.
 
 We have to call Object.hasOwnProperty to verify that the value is
 defined on this object, rather than a superclass, since normal Object
 properties are also visible on this object.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>key</CODE> - to lookup
<DT><B>Returns:</B><DD>the value
<DT><B>Throws:</B>
<DD><CODE>java.util.MissingResourceException</CODE> - if the value is not found</DL>
</DD>
</DL>
<HR>

<A NAME="keySet()"><!-- --></A><H3>
keySet</H3>
<PRE>
public java.util.Set&lt;java.lang.String&gt; <B>keySet</B>()</PRE>
<DL>
<DD>The set of keys associated with this dictionary.
<P>
<DD><DL>

<DT><B>Returns:</B><DD>the Dictionary set</DL>
</DD>
</DL>
<HR>

<A NAME="toString()"><!-- --></A><H3>
toString</H3>
<PRE>
public java.lang.String <B>toString</B>()</PRE>
<DL>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE>toString</CODE> in class <CODE>java.lang.Object</CODE></DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="values()"><!-- --></A><H3>
values</H3>
<PRE>
public java.util.Collection&lt;java.lang.String&gt; <B>values</B>()</PRE>
<DL>
<DD>Collection of values associated with this dictionary.
<P>
<DD><DL>

<DT><B>Returns:</B><DD>the values</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>


<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../com/google/gwt/i18n/client/DateTimeFormat.html" title="class in com.google.gwt.i18n.client"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../com/google/gwt/i18n/client/HasDirection.html" title="interface in com.google.gwt.i18n.client"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../../index.html?com/google/gwt/i18n/client/Dictionary.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="Dictionary.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->

<HR>

</BODY>
</HTML>
